<template>
  <div class="block">
    <span class="demonstration">请打分</span>
    <el-rate v-model="value2"
             :colors="colors">
    </el-rate>
    <button @click="clickhandler">点击访问后端接口</button>
  </div>

</template>

<script>
export default {
  data() {
    return {
      value1: null,
      value2: null,
      colors: ['#99A9BF', '#F7BA2A', '#FF9900'], // 等同于 { 2: '#99A9BF', 4: { value: '#F7BA2A', excluded: true }, 5: '#FF9900' }
      id: 2,
    }
  },
  methods: {
    clickhandler() {
      this.$axios.get('/rbacManager/queryById/' + this.id).then((res) => {
        console.log(res)
      })
    },
  },
}
</script>